$ () ->
	$("#create_btn").click (e) ->
		param =
			ct_name: $("#ct_name").val()

		$.post "/api/admin/commodity/add-type",param,(res) ->
			if res.status.errCode is 0
				alert "添加成功"
				window.location.href = "/admin/commodity-type/index"
			else
				alert res.status.message

	$("#cancel_btn").click (e) ->
		window.location.href = "/admin/commodity-type/index"